#================================================================
#	This is the global Makefile of Cgal_Python
#===============================================================
Bindings = bindings
Test = test
Kernel_module = Kernel
Triangulation_2_module = Triangulations_2
Triangulation_3_module = Triangulations_3
Convex_hull_2_module = Convex_hull_2
Geometric_Optimisation_module = Geometric_Optimisation
Polyhedron_module = Polyhedron
Mesh_2_module = Mesh_2
Alpha_shapes_2_module = Alpha_shapes_2
Alpha_shapes_3_module = Alpha_shapes_3

Documentation = doc
MAKE = make

all:
	@echo '======================================================='
	@echo 'Compiling of CGAL package'
	@echo 'Be patient this may take a while'
	@echo '======================================================='

	@(cd $(Bindings)/$(Kernel_module) && $(MAKE)) 
	@(cd $(Bindings)/$(Triangulation_2_module) && $(MAKE)) 
	@(cd $(Bindings)/$(Triangulation_3_module) && $(MAKE)) 
	@(cd $(Bindings)/$(Convex_hull_2_module) && $(MAKE)) 
	@(cd $(Bindings)/$(Geometric_Optimisation_module) && $(MAKE)) 
	@(cd $(Bindings)/$(Mesh_2_module) && $(MAKE))
	@(cd $(Bindings)/$(Polyhedron_module) && $(MAKE))
	@(cd $(Bindings)/$(Alpha_shapes_2_module) && $(MAKE))
	@(cd $(Bindings)/$(Alpha_shapes_3_module) && $(MAKE))
tests:
	@(cd $(Test) && $(MAKE) )

clean:
	@(cd $(Bindings)/$(Kernel_module) && $(MAKE) clean) 
	@(cd $(Bindings)/$(Triangulation_2_module) && $(MAKE) clean)
	@(cd $(Bindings)/$(Triangulation_3_module) && $(MAKE) clean)
	@(cd $(Bindings)/$(Convex_hull_2_module) && $(MAKE) clean) 
	@(cd $(Bindings)/$(Geometric_Optimisation_module) && $(MAKE) clean) 
	@(cd $(Bindings)/$(Mesh_2_module) && $(MAKE) clean) 
	@(cd $(Bindings)/$(Polyhedron_module) && $(MAKE) clean) 
	@(cd $(Bindings)/$(Alpha_shapes_2_module) && $(MAKE) clean) 
	@(cd $(Bindings)/$(Alpha_shapes_3_module) && $(MAKE) clean) 

Doc:
	@(cd $(Documentation) && $(MAKE))

package:
	@rm -f ./cgal_package/CGAL/*.so
	@cp $(Bindings)/$(Kernel_module)/$(Kernel_module).so  ./cgal_package/CGAL/.
	@cp $(Bindings)/$(Triangulation_2_module)/$(Triangulation_2_module).so  ./cgal_package/CGAL/.
	@cp $(Bindings)/$(Triangulation_3_module)/$(Triangulation_3_module).so  ./cgal_package/CGAL/.
	@cp $(Bindings)/$(Convex_hull_2_module)/$(Convex_hull_2_module).so  ./cgal_package/CGAL/.
	@cp $(Bindings)/$(Geometric_Optimisation_module)/$(Geometric_Optimisation_module).so  ./cgal_package/CGAL/.
	@cp $(Bindings)/$(Mesh_2_module)/$(Mesh_2_module).so  ./cgal_package/CGAL/.
	@cp $(Bindings)/$(Polyhedron_module)/$(Polyhedron_module).so  ./cgal_package/CGAL/.
	@cp $(Bindings)/$(Alpha_shapes_2_module)/$(Alpha_shapes_2_module).so  ./cgal_package/CGAL/.
	@cp $(Bindings)/$(Alpha_shapes_3_module)/$(Alpha_shapes_3_module).so  ./cgal_package/CGAL/.
